<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模块化</title>
</head>
<body>
<script>
    var module1=(function(){
        var _count = 0;
        var m1 = function(){
            console.log(1);
        };
        var m2 = function(){
            console.log(2);
        };
        return {
            m1:m1,
            m2:m2
        }
    })();
    //用自执行函数，去包裹变量，防止污染私有变量；
    console.log(module1._count);//undefined;

</script>
</body>
</html>